<!DOCTYPE html>
<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.*,cn.nawang.ebeim.api.domain.User,cn.nawang.ebeim.api.utils.Constant"%>
<%
  String ctx = request.getContextPath();
  User user=(User) request.getSession().getAttribute("user");
%>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>首页</title>
<link rel="stylesheet" type="text/css" href="css/basic.css">
<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/ui.css">
<link rel="stylesheet" type="text/css" href="css/g.css">

<!-- 设置JS全局变量  ctx -->
<script type="text/javascript">
	var ctx = "<%=request.getContextPath()%>";
	<%
	String sessUserId = "";
	String sessUserName = "";
	String role="";
	String roleName="";
	HttpSession Session = request.getSession();
	User sessStr = (User)Session.getAttribute("user");
	if(sessStr != null ){
	  sessUserId = sessStr.getId();
	  sessUserName = sessStr.getName();
	  role=sessStr.getRole();
	  roleName=Constant.ROLE.get(role);
	}
	%>
	var loginUser;
	var isLogin="<%= sessUserId%>";
	if(isLogin==""){
		window.location.href="login.jsp" ;
	}else{
		loginUser = {
				"role":"<%= role%>",
				"id":"<%= sessUserId%>"
		};
	}
</script>
</head>
<div class="header">
	<div class="navbar-inner clearfix">
		<a class="brand fl"> <img src="images/brand_logo.png" height="63"
			width="63" alt="logo">
		</a>
		<div class="brand-title-long fl">
			<img src="images/brand_title_long.png" height="63" width="360">
		</div>
		<div class="brand-title-short fl">
			<img src="images/brand_title_short.png" height="63" width="119">
		</div>
		<ul class="nav fl clearfix">
			<li><a href="index.jsp">
					<div class="nav-ico nav-home-ico"></div>
					<p>首页</p>
			</a></li>
			<li><a href="terminal.jsp">
					<div class="nav-ico nav-gear-ico"></div>
					<p>数据源列表</p>
			</a></li>
			<li><a href="userlist.jsp">
					<div class="nav-ico nav-mail-ico"></div>
					<p>用户管理</p>
			</a></li>
			<li><a href="monitor_save.jsp">
					<div class="nav-ico nav-recover-ico"></div>
					<p>安全审计</p>
			</a></li>
			<%
				if(user!=null&&"SYSADMIN".equals(user.getRole())){
			%>
			<li><a href="customerList.jsp">
                    <div class="nav-ico nav-mail-ico"></div>
                    <p>后台管理</p>
            </a></li>
            <%
            	}
            %>
            <li><a href="<%= ctx+"/EbeimService.exe" %>">
					<div class="nav-ico nav-question-ico"></div>
					<p>下载客户端</p>
			</a></li>
		</ul>
		<div class="welcome fr clearfix">
			<input type="hidden" value="<%= sessUserId %>" id="onlineUserId" />
			<a href="userinfo.jsp" class="clearfix">
			<em class="icos icos-user"></em><span title="<%=roleName %>">你好,<%= sessUserName %></span></a> 
			<a href="javascript:;" class="j-logout clearfix"><em class="icos icos-power"></em><span>安全退出</span></a>
		</div>
	</div>
</div>